home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / cli / okami15.lzh / OKAMI15 / SOURCE / GEM.C < prev    next >
C/C++ Source or Header  |  1992-09-20  |  1KB  |  66 lines

  1. /*************************************************************************
  2.  
  3.     Aufruf von Accessories von der Okami-Shell aus
  4.  
  5.         von Wolfram Rösler
  6.  
  7. **************************************************************************/
  8.  
  9. #include <stdlib.h>
  10. #include <string.h>
  11. #include <ctype.h>
  12. #include <aes.h>
  13.  
  14. #define RSCFILE    "gem.rsc"
  15.  
  16. int main(void)
  17. {
  18.   OBJECT *Tree;
  19.   int buf[8];
  20.   char *Cmd;
  21.  
  22.   appl_init();
  23.  
  24.   /* Resourcefile laden. */
  25.   if (rsrc_load(RSCFILE)==0)
  26.   {
  27.     form_alert(1,"[3][gem:|Resource file `" RSCFILE "' not found][  Pity  ]");
  28.     appl_exit();
  29.     return 1;
  30.   }
  31.  
  32.   rsrc_gaddr(0,0,&Tree);
  33.  
  34.   for(;;)
  35.   {
  36.     menu_bar(Tree,1);
  37.  
  38.     /* Warten auf Menüklick... */
  39.     evnt_mesag(buf);
  40.  
  41.     if (buf[0]==10)
  42.       menu_tnormal(Tree,buf[3],1);
  43.  
  44.     menu_bar(Tree,0);
  45.  
  46.     if (buf[0]==10)
  47.     {
  48.       /* Kommando aus dem Objektbaum holen. */
  49.       Cmd = Tree[buf[4]].ob_spec.free_string;
  50.       while(isspace(*Cmd)) Cmd++;
  51.  
  52.       /* Test auf Abbruchbedingung. */
  53.       if (strncmp(Cmd,"exit",4)==0)
  54.         break;
  55.  
  56.       graf_mouse(256,0);
  57.       system(Cmd);
  58.       graf_mouse(257,0);
  59.     }
  60.   }
  61.   
  62.   rsrc_free();
  63.   appl_exit();
  64.  
  65.   return 0;
  66. }